package com.example.administrator.myapplication.uilts;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.example.administrator.myapplication.R;
import java.util.ArrayList;

/**
 * Created by 董豪华 on 2017/1/12.
 */
public class FragmentAdpaterPingdao extends BaseAdapter {
    ArrayList<Pingdaoshuju> mpingda;
    Context context;
    public FragmentAdpaterPingdao(Context context, ArrayList<Pingdaoshuju> listpingdao){
        this.context = context;
        this.mpingda = listpingdao;
    }
    @Override
    public int getCount() {
        return mpingda.size();
    }

    @Override
    public Object getItem(int position) {
        return mpingda.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View v = View.inflate(context, R.layout.dianshi_item,null);
        TextView tv_pingdao = (TextView) v.findViewById(R.id.tv_pingdao);
        tv_pingdao.setText(mpingda.get(position).getPingdaoname());
        return v;
    }




}
